package automateWebElements;

import org.openqa.selenium.firefox.FirefoxDriver;

public class DynamicDropDown {
    public static void main(String[] args) throws InterruptedException {
        FirefoxDriver driver = new FirefoxDriver();
        driver.get("https://rahulshettyacademy.com/dropdownsPractise/");

        driver.findElementByXPath("//input[@id='ctl00_mainContent_ddl_originStation1_CTXT']").click();
        driver.findElementByXPath("(//a[@value='CCU'])").click();
        Thread.sleep(200);
//        driver.findElementByXPath("(//a[@value='MAA'])[2]").click();

        // handle without indexes (parent and child principle)
        driver.findElementByXPath("//div[@id='glsctl00_mainContent_ddl_destinationStation1_CTNR'] //a[@value='GOP']").click();

        driver.findElementByLinkText("24").click();

    }
}
